<?php

    include "../config.php";

    $db = new SQLite3("../db/" . $squid_database, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
    if (!$db || !file_exists("../db/" . $squid_database)) {
        exit("Create database error. Termination");
    }
    else {
        echo "Database created";
        echo "<br>";
        echo "Inserting table structure";
        echo "<br>";
        $db -> query("CREATE TABLE IF NOT EXISTS users_data (
            id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
            username VARCHAR(64) NOT NULL,
            password VARCHAR(64) NOT NULL,
            comments VARCHAR(128) NOT NULL)");
        echo "All done";
        $db -> close();
    }
?>
